home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / STRINGS / TPSTR7 / EXAM34.PAS < prev    next >
Pascal/Delphi Source File  |  1993-03-15  |  3KB  |  66 lines

  1. Program Exam34;
  2.  
  3. {**************************************************************************}
  4. {                                                                          }
  5. { Ce programme démontre les possibilités de Delete et Pos.                 }
  6. {                                                                          }
  7. {**************************************************************************}
  8.  
  9. Uses
  10.   TpStr;
  11.  
  12. Var
  13.   S1 ,
  14.   S2 : String;
  15.   I  : Integer;
  16.  
  17. {  ---------------------------------------------------------------         }
  18. {  Procedure   Delete(Var Str: String;Index,Count);                        }
  19. {  ---------------------------------------------------------------         }
  20. {                                                                          }
  21. {  Effet     : Strictement identique à la fonction Delete de Turbo Pascal. }
  22. {                                                                          }
  23. {  Usage     : Chaîne pascal.                                              }
  24. {                                                                          }
  25. {  Vitesse   : 7800/s                                                      }
  26. {                                                                          }
  27. { -------------------------------------------------------------------------}
  28.  
  29. Procedure Test1;
  30. Begin
  31.   S1 := 'abcdefghijklmnopqrstuvwxyz';
  32.   Delete(S1,1,13);
  33.   S1 := 'abcdefghijklmnopqrstuvwxyz';
  34.   Delete(S1,14,50);
  35.   S1 := 'abcdefghijklmnopqrstuvwxyz';
  36.   Delete(S1,1,1);
  37. end;
  38.  
  39. {  ---------------------------------------------------------------         }
  40. {  Function   Pos(Find,Str: String):Integer;                               }
  41. {  ---------------------------------------------------------------         }
  42. {                                                                          }
  43. {  Effet     : Strictement identique à la fonction Pos de Turbo-Pascal.    }
  44. {                                                                          }
  45. {  Usage     : Chaîne pascal.                                              }
  46. {                                                                          }
  47. {  Vitesse   : 7800/s                                                      }
  48. {                                                                          }
  49. { -------------------------------------------------------------------------}
  50.  
  51. Procedure Test2;
  52. Begin
  53.   S1 := 'abcdefghijklmnopqrstuvwxyz';
  54.   I := Pos('fghi',S1);
  55.   I := Pos('fgih',S1);
  56.   I := Pos('a',S1);
  57.   I := Pos('abcdefghijklmnopqr',S1);
  58. end;
  59.  
  60. Begin
  61.   Test1;
  62.   Test2;
  63. End.
  64.  
  65. { -------------------------------------------------------------------------}
  66.